import http from '@/utils/axios'
//登录
export function login(data) {
    return http({
        method: 'post',
        url: '/user/login',
        data
    })
}
//获取登录用户详情 
export function userinfo() {
    return http({
        method: 'get',
        url: '/user/info',
    })
}
//退出
export function logout() {
    return http({
        method: 'post',
        url: '/user/logout',
    })
}
//贷款申请
export function loanCreate(data) {
    return http({
        method: 'post',
        url: '/loan/create',
        data
    })
}
// 申请管理             
export function loanList(data) {
    return http({
        method: 'get',
        url: '/loan/list',
        params: data
    })
}
// 申请管理--提交
export function loanSubmitToApprove(data) {
    return http({
        method: 'post',
        url: '/loan/submitToApprove',
        data
    })
}
// 申请管理 -- 编辑
export function loanUpdate(data) {
    return http({
        url: 'loan/update',
        method: 'put',
        data
    })
}
// 申请管理 -- 删除
export function loanDelete(data) {
    return http({
        url: `/loan/delete/${data.id}`,
        method: 'delete',
    })
}
// 贷款审批-初审-查询
export function approveFirstList(data) {
    return http({
        url: 'approve/first/list',
        method: 'get',
        params: data
    })
}
// 贷款审批 -初审-查看详情
export function loanQuery(data) {
    return http({
        url: 'loan/query',
        method: 'get',
        params: data
    })
}
// 贷款审批 -初审-通过
export function approveFirstPass(data) {
    return http({
        url: 'approve/first/pass',
        method: 'post',
        data
    })
}
// 贷款审批 -初审-拒绝
export function approveFirstReject(data) {
    return http({
        url: 'approve/first/reject',
        method: 'post',
        data
    })
} // 贷款审批 -终审-查看详情
export function loanEndQuery(data) {
    return http({
        url: 'loan/query',
        method: 'get',
        params: data
    })
}
// 贷款审批 -终审-通过
export function approveEndPass(data) {
    return http({
        url: 'approve/end/pass',
        method: 'post',
        data
    })
}
// 贷款审批 -终审-拒绝
export function approveEndReject(data) {
    return http({
        url: 'approve/end/reject',
        method: 'post',
        data
    })
} 
// 贷款审批 -终审-查询
export function approveEndList(data) {
    return http({
        url: 'approve/end/list',
        method: 'get',
        params: data
    })
} // 标的管理 -查询
export function contractList(data) {
    return http({
        url: 'contract/list',
        method: 'get',
        params: data
    })
}
// 标的管理 -生成合同
export function contractCreateFile(data) {
    return http({
        url: 'contract/createFile',
        method: 'post',
        data
    })
} 
// 标的管理 -下载合同
export function contractDownload(data) {
    return http({
        url: 'contract/download',
        method: 'get',
        params: data
    })
}
export function permissionCreateUser (data) { // 权限管理 -创建管理员
    return http ({
      url:'permission/createUser',
      method:'post',
      data
    })
  }
  
  export function permissionUserlist () { // 权限管理 -列表展示
    return http ({
      url:'user/list',
      method:'get',
    })
  }